<div class="vheader">
    <h1><?php echo $this->Programs->d->Program ?></h1>
    <p><?php echo $this->translate("Program") ?>
</div>

<div class="vcontent">
<div class="cell dd200">
    <dl>
        <dt><?php echo $this->translate("Program") ?></dt>
        <dd><?php echo $this->Programs->d->Program ?></dd>
        <dt><?php echo $this->translate("Status") ?></dt>
        <dd><?php echo $this->Programs->d->Status ?></dd>
        <dt><?php echo $this->translate("Code") ?></dt>
        <dd><?php echo $this->Programs->d->ProgramId ?></dd>
        <dt><?php echo $this->translate("Product line") ?></dt>
        <dd><?php echo $this->replaceEmpty($this->Programs->d->ProductLine,'-')  ?></dd>
        <dt><?php echo $this->translate("Survey") ?></dt>
        <dd><?php echo $this->replaceEmpty($this->Programs->d->SurveyName,'-') ?></dd>
        <dt><?php echo $this->translate("Public sp.") ?></dt>
        <dd><?php echo $this->Programs->d->PublicSponsorship ?></dd>
        <dt><?php echo $this->translate("Funds") ?></dt>
        <dd><?php foreach($this->Programs->r->funds as $fund) echo $fund->Fund .'<br />' ?></dd>
        <dt><?php echo $this->translate("Locations") ?></dt>
        <dd><?php foreach($this->Programs->r->locations as $location) echo $location->Name .'<br />' ?></dd>
        <dt><?php echo $this->translate("Comments") ?></dt>
        <dd><?php echo $this->replaceEmpty($this->Programs->d->Comments,'-') ?></dd>
    </dl>
</div>
    
    <?php if(isset($this->Programs->p->Score)): ?>
    
    <div class="cell dt200">
        <dl>
            <dt><li class="<?php echo $this->Programs->p->c->Clients ?>"><?php echo $this->translate("Clients") ?></dt>
            <dd><?php echo (int) $this->Programs->p->Clients ?></dd>
            <dt><li class="<?php echo $this->Programs->p->c->FemalePercentage ?>"><?php echo $this->translate("Female percentage") ?></dt>
            <dd><?php echo $this->Programs->p->FemalePercentage ?></dd>
            <dt><li class="<?php echo $this->Programs->p->c->BalancePrincipal ?>"><?php echo $this->translate("Balance") ?></dt>
            <dd><?php echo number_format($this->Programs->p->BalancePrincipal, 2, '.', ',') ?></dd>
            <dt><li class="<?php echo $this->Programs->p->c->Par15 ?>"><?php echo $this->translate("PAR 15") ?></dt>
            <dd><?php echo $this->Programs->p->Par15 ?></dd>
            <dt><li class="<?php echo $this->Programs->p->c->WriteOffPercentage ?>"><?php echo $this->translate("Write-off percentage") ?><sup>1</sup></dt>
            <dd><?php echo $this->Programs->p->WriteOffPercentage ?></dd>
            <dt><li class="<?php echo $this->Programs->p->c->Interest ?>"><?php echo $this->translate("Op. income") ?><sup>1</sup></dt>
            <dd><?php echo number_format($this->Programs->p->Interest, 2, '.', ',') ?></dd>
            <dt><li class="<?php echo $this->Programs->p->c->Disbursements ?>"><?php echo $this->translate("Disbursements") ?><sup>1</sup></dt>
            <dd><?php echo (int) $this->Programs->p->Disbursements ?></dd>
            <dt><li class="<?php echo $this->Programs->p->c->DisbursedAmount ?>"><?php echo $this->translate("Disbursed amount") ?><sup>1</sup></dt>
            <dd><?php echo number_format($this->Programs->p->DisbursedAmount, 2, '.', ',') ?></dd>  
            <dt></dt><dd></dd>
            <dt><sup>1</sup> <?php echo $this->translate("Previous 30 days") ?></dt><dd></dd>  
        </dl>
    </div>

    <div class="cell dt200">
        <div class="scoreLabel"><?php echo $this->translate("Score") ?></div>
        <div class="scoreBadge">
            <div id="score" class="<?php echo $this->Programs->p->c->Score ?>"><?php echo $this->Programs->p->Score; ?></div>
        </div>
    </div>
    
    <?php endif; ?>

<?php //echo $this->partial('partials/performance.phtml', $this->Programs->p); ?>
              
</div>

<div class="vfooter2">
 <div class="menu">
     <a style="text-decoration: none"><?php echo $this->translate("Loan applications:") ?></a>
     <?php echo $this->link('/loan/application/browse', array('ProgramId'=>$this->Programs->d->ProgramId,'Program'=>$this->Programs->d->Program,'Status'=>'New'),$this->translate("New"),array('target' => 'bottom')) ?>
     <?php echo $this->link('/loan/application/browse', array('ProgramId'=>$this->Programs->d->ProgramId,'Program'=>$this->Programs->d->Program,'Status'=>'Rejected'),$this->translate("Rejected"),array('target' => 'bottom')) ?>
     <?php echo $this->link('/loan/loan-master/browse', array('ProgramId'=>$this->Programs->d->ProgramId,'Program'=>$this->Programs->d->Program,'Status'=>'Submitted'),$this->translate("Submitted"),array('target' => 'bottom')) ?>
     <?php echo $this->link('/loan/loan-master/browse', array('ProgramId'=>$this->Programs->d->ProgramId,'Program'=>$this->Programs->d->Program,'Status'=>'Re-Submitted'),$this->translate("Re-Submitted"),array('target' => 'bottom')) ?>
     <?php echo $this->link('/loan/loan-master/browse', array('ProgramId'=>$this->Programs->d->ProgramId,'Program'=>$this->Programs->d->Program,'Status'=>'Reviewed'),$this->translate("Reviewed"),array('target' => 'bottom')) ?>
     <?php echo $this->link('/loan/loan-master/browse', array('ProgramId'=>$this->Programs->d->ProgramId,'Program'=>$this->Programs->d->Program,'Status'=>'Approved'),$this->translate("Approved"),array('target' => 'bottom')) ?>
     <?php echo $this->link('/loan/loan-master/browse', array('ProgramId'=>$this->Programs->d->ProgramId,'Program'=>$this->Programs->d->Program,'Status'=>'Executed'),$this->translate("Executed"),array('target' => 'bottom')) ?>
     <?php echo $this->link('/loan/loan-master/browse', array('ProgramId'=>$this->Programs->d->ProgramId,'Program'=>$this->Programs->d->Program,'Status'=>'Disbursed'),$this->translate("Disbursed"),array('target' => 'bottom')) ?>
     <?php echo $this->link('/loan/loan-master/browse', array('ProgramId'=>$this->Programs->d->ProgramId,'Program'=>$this->Programs->d->Program,'Status'=>'Withdrawn'),$this->translate("Withdrawn"),array('target' => 'bottom')) ?>
 </div>
</div>

<div class="vfooter">
    <div class="menu">     
        <?php echo $this->link('/loan/active-loan/browse', array('ProgramId'=>$this->Programs->d->ProgramId,'Program'=>$this->Programs->d->Program),$this->translate("Active loans"),array('target' => 'bottom')) ?>
        <?php echo $this->link('/loan/active-loan/browse', array('ProgramId'=>$this->Programs->d->ProgramId,'Status'=>'Delinquent','Delinquent'=>'1','Program'=>$this->Programs->d->Program),$this->translate("Delinquent loans"),array('target' => 'bottom')) ?>
        <?php echo $this->link('/loan/legal/browse', array('ProgramId'=>$this->Programs->d->ProgramId,'Status'=>'Written-Off','Program'=>$this->Programs->d->Program),$this->translate("Written-Off loans"),array('target' => 'bottom', 'text' => true)) ?>
        <?php echo $this->link('/loan/legal/browse', array('ProgramId'=>$this->Programs->d->ProgramId,'Status'=>'Recovered','Program'=>$this->Programs->d->Program),$this->translate("Recovered loans"),array('target' => 'bottom', 'text' => true)) ?>
        <?php echo $this->link('/loan/loan/browse', array('ProgramId'=>$this->Programs->d->ProgramId,'Status'=>'Paid','Program'=>$this->Programs->d->Program),$this->translate("Paid loans"),array('target' => 'bottom', 'text' => true)) ?>
        |
        <?php echo $this->link('/admin/performance-metric-program/browse', array('ProgramId'=>$this->Programs->d->ProgramId,'Program'=>$this->Programs->d->Program),$this->translate("Custom metrics"),array('target' => 'bottom', 'text' => true)) ?>
        <?php echo $this->link('/admin/performance-metric-program/add', array('ProgramId'=>$this->Programs->d->ProgramId),$this->translate("Add custom metric"),array('text' => true)) ?>
        <?php echo $this->link('/admin/performance-data/browse', array('ProgramId'=>$this->Programs->d->ProgramId,'Program'=>$this->Programs->d->Program),$this->translate("Performance data"),array('target' => 'bottom', 'text' => true)) ?>
        <?php echo $this->link('/admin/program/performance-chart', array('id'=>$this->Programs->d->ProgramId),$this->translate("Performance charts")) ?>
        |
        <?php echo $this->link('/admin/program/add', array('id'=>$this->Programs->d->ProgramId),$this->translate("Edit")) ?>                 
    </div>
</div>

<!-- Tooltips -->
<div data-dojo-type="dijit.Tooltip" data-dojo-props="connectId:'score',position:['below']">
    <?php echo $this->translate("Performance score") ?>
</div>
<!-- Tooltips /-->

